package com.leoandroid.tool.toolsbox.largeread.activity

import android.annotation.SuppressLint
import android.os.Bundle
import com.leoandroid.tool.toolsbox.largeread.databinding.ActivityEatBinding


class EatActivity: com.leoandroid.tool.toolsbox.largeread.activity.BaseActivity() {

    var bindingF: ActivityEatBinding?=null
    val binding get() = bindingF!!
    var value:String=""

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        bindingF = ActivityEatBinding.inflate(layoutInflater)
        setContentView(binding.root)
        if(intent!= null){
            value = intent.getStringExtra(key).toString()
        }
        initWebView()
    }

    companion object{
        val key:String="KEY"
    }

    @SuppressLint("SetJavaScriptEnabled")
    fun initWebView(){
         binding.webview.settings.javaScriptEnabled = true
        // val str = "file:///android_asset/game/2048/index.html"     2048 可以
        // val str = "file:///android_asset/game/daoshuri/index.html"  倒数日 可以
        //val str = "file:///android_asset/game/dianjita/index.html"  电吉他 可以
       // val str = "file:///android_asset/game/jintianchishenme/index.html" 今天吃什么 可以
        binding.webview.loadUrl(value)
    }
}